package com.base.service.client;

import java.util.*;

abstract public class ClientOppAbstract {
	private AdvanceClientService acs;
	private ClientFormBean bean;
	private Integer state;
	private String tip;
	
	public ClientOppAbstract(){
		this.acs= AdvanceClientService.getInstance();
		bean =  new ClientFormBean();
		this.state=0;
		this.tip="";
	}

	public int waste(Integer cid){
		return acs.changeState(cid, 2);
	}
	
	
	
	public List<ClientFormBean> queryList(ClientQueryFormBean queryForm,int offset,int pageSize){
	try{	
		List<Integer> cids = this.acs.QueryCidList(queryForm, offset, pageSize);
		return this.acs.getDetailByCidList(cids);
	}catch(Exception e){
		e.printStackTrace();
		return null;
	}	
	}
	
	/**
	 * shareCode=toUid+cid+random+state 
	 * @param shareFrom
	 * @param shareTo
	 * @param cid
	 * @param shareState 0:请求  1:同意  2:完成  3:拒绝 
	 * @return <0 分享失败
	 * 
	 */
	abstract public int share(Integer shareFrom,Integer shareTo,Integer cid,Integer shareState);
	
	
	abstract public  ClientFormBean merge(ClientFormBean bean);
}
